package wnxy.wn44.shopwn.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import wnxy.wn44.shopwn.entity.TShopcart;
import wnxy.wn44.shopwn.mapper.TShopcartMapper;
import wnxy.wn44.shopwn.service.ShopService;

import java.util.List;
@Service
public class ShopServiceImpl implements ShopService {
    private TShopcartMapper shopcartMapper;

    @Autowired
    public void setShopcartMapper(TShopcartMapper shopcartMapper) {
        this.shopcartMapper = shopcartMapper;
    }

    @Override
    public List<TShopcart> findAll() {
        List<TShopcart> list=shopcartMapper.findAll();
        return list;
    }

    @Override
    public List<TShopcart> findByCondition(TShopcart shopcart) {
        List<TShopcart> list=shopcartMapper.findCondition(shopcart);
        return list;
    }

    @Override
    public boolean deletebyId(Integer id) {
        int i = shopcartMapper.deleteByIds(id);
        return i!=0;
    }

    @Override
    public boolean addShop(TShopcart shopcart) {
        int i = shopcartMapper.addShopCart(shopcart);
        return i!=0;
    }

    @Override
    public boolean updateShop(TShopcart shopcart) {
        int i = shopcartMapper.UpdateShopcart(shopcart);
        return i!=0;
    }
}
